package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	filePath := "a.txt"
	file, err := os.OpenFile(filePath, os.O_WRONLY | os.O_APPEND, 0666)
	if err != nil{
		fmt.Println("error=",err)
		return
	}
	defer file.Close()

	str := "alibaba"
	writer := bufio.NewWriter(file)

	for i := 0; i<10; i++{
		writer.WriteString(str)
	}
	writer.Flush()
}

